package com.learn.file;

import java.io.FileInputStream;
import java.util.Arrays;

public class TestFileInputStream {
    public static void main(String[] args) throws Exception {
        FileInputStream fileInputStream = new FileInputStream("target/classes/application.yml");
//        System.out.println(fileInputStream.read());

//        int c;
//        while ((c = fileInputStream.read()) != -1){
//            System.out.print((char)c);
//        }

        byte[] bytes = new byte[7];
        int len;
        while ((len=fileInputStream.read(bytes)) != -1){
            System.out.println(len);
            System.out.println(Arrays.toString(bytes));
            System.out.println(new String(bytes, 0, len));
        }

        fileInputStream.close();
    }
}
